Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal components update #85

Merged
merged 35 commits into from
Jan 6, 2025
Merged

Modal components update #85

merged 35 commits into from
Jan 6, 2025

Conversation

mkrause
Copy link
Collaborator

@mkrause mkrause commented Jan 2, 2025

This PR:

  • Introduces a new ModalProvider component that can be used to create controlled modal dialogs.
  • Implements a DialogModal component which uses ModalProvider and Dialog to implement various modals (centered, sliding, full screen).
  • Implements useModalWithSubject for easy sharing of a modal component.
  • Implements useConfirmation that builds on useModalWithSubject but is tailored for confirmation dialogs.
  • Adds a SpinnerModal component for a modal Spinner.
  • Removes the Modal component, consumers will need to use DialogModal instead.

Screenshot 2025-01-05 at 01 16 27

TODO:

  • Implement a way for Dialog action buttons to communicate with the Dialog/Modal. Currently in the stories none of the action buttons (like Cancel, Submit) are able to close the modal.
  • Currently modals don't have a minimum size. Investigate if we can set a minimum (and what that should be), without breaking responsive design (i.e. modals should still be able to shrink on small viewports). EDIT: Split out to Modal: minimum width? #91
  • Investigate Safari bug (see comment below).

Base automatically changed from mkrause/241230-dialog-update to master January 3, 2025 13:38
@mkrause mkrause marked this pull request as ready for review January 5, 2025 00:15
@mkrause
Copy link
Collaborator Author

mkrause commented Jan 5, 2025

Need to investigate a bug in Safari 17.6 where, when opening a submodal, the close button in the parent modal remains focused. When you then press "space", all the modals are suddenly closed although the page remains inert for a bit until the dialogs unmount.

Screenshot 2025-01-05 at 20 53 14

UPDATE: Checked it again in v18.2 and apparently it's now fixed.

@mkrause mkrause requested a review from spli02 January 6, 2025 14:26
@mkrause mkrause mentioned this pull request Jan 6, 2025
@mkrause mkrause merged commit 84674f6 into master Jan 6, 2025
3 checks passed
@mkrause mkrause deleted the mkrause/241230-modal-update branch January 6, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants